- 
                Notifications
    You must be signed in to change notification settings 
- Fork 327
FIX: out of range exception when pressing undo after creating and editing a new control scheme (ISXB-1607) #2237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…ed by Undoing the creation of it via ctrl+z.
| Codecov ReportAttention: Patch coverage is  
 @@             Coverage Diff             @@
##           develop    #2237      +/-   ##
===========================================
+ Coverage    76.70%   76.81%   +0.10%     
===========================================
  Files          465      476      +11     
  Lines        87919    88655     +736     
===========================================
+ Hits         67442    68097     +655     
- Misses       20477    20558      +81     Flags with carried forward coverage won't be shown. Click here to find out more. 
 ... and 26 files with indirect coverage changes 🚀 New features to boost your workflow:
 | 
        
          
                ...ges/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...ges/com.unity.inputsystem/InputSystem/Editor/UITKAssetEditor/Views/InputActionsEditorView.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly asking question at this point since I am not sure I understand this fix or problem yet....
…editing-new-controlscheme
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this Darren, not sure I fully understand the fix but it seems legit. Since the editor is something where we do not have the greatest coverage, do you think it would be feasible to auto-test this regression somehow? If not or unfeasible I think it can land as-is with manual testing.
…editing-new-controlscheme
| Merged develop into this branch to get critical CI fix from #2260. Hope this doesn't caused any inconvenience for you. | 
…editing-new-controlscheme
Description
You could cause multiple null or out of range exceptions if you press undo while editing a control scheme.
This is caused by undo causing the control scheme to be removed while you still have the edit window open.
Now the edit window will close immediately if you press undo while it's open.
Ticket:
https://jira.unity3d.com/browse/ISXB-1607
Video of fix (Usually undoing when editing the new control scheme would throw an exception / it could also cause other exceptions if the window was left open, therefore I now close it when this happens to avoid future issues):
Screen.Recording.2025-10-07.at.15.06.14.mov
Testing status & QA
Tested manually all the cases I could find until all exceptions were gone. There was multiple paths to create exceptions due to the asset being removed via undo.
Overall Product Risks
Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.
Comments to reviewers
Please describe any additional information such as what to focus on, or historical info for the reviewers.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: